package com.ruoyi.system.webgroupservcie;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.system.domain.webgroup.Clock;
import com.ruoyi.system.domain.webgroup.DailyList;
import com.ruoyi.system.domain.webgroup.GeneralList;
import com.ruoyi.system.domain.webgroup.WeeklyList;
import org.springframework.format.annotation.DateTimeFormat;

import java.sql.Time;
import java.util.Date;
import java.util.List;

public interface ClockService {

    List<Clock> selectClockAll(Clock clock);

    Clock getClock(Integer clockId);

    int deleteClock(Integer[] clockIds);

    void postClock(Clock clock);

    int putClock(Clock clock);

    Integer getClockState(Integer userId, Date clockDatetime);

    /**查询当前日期下第二高clock_id的日期*/
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    Date getClockDatetime(Integer userId);

    /**
     * 查询俩日期相减后的值
     */
    Time getTimeDiff(Date d1 , Date d2);

    /**
     * 下列方法是对日榜操作的
     */

    /**查询当前日期的主键id（dailyListId）*/
    Integer selectDailyList(String dateString, Integer userId);

    /**插入当前的值（当查询当前日期的主键id为null时）*/
    void insertIntoDailyList(DailyList dailyList);
    /**插入当前的日期和id，在mybatis中相加*/
    void insertIntoDailyListById(Integer dailyListId, Time timeDiff);

    /**下列总榜的操作*/
    //查询当前用户有没有记录
    Integer selectGeneralList(Integer userId);
    //新增用户数据
    void insertIntoGeneralList(GeneralList generalList);
    //累加时间
    void updateGeneralList(Integer generalListId, Time timeDiff);

    /**下列周榜的操作*/
    //(1)日榜

    List<DailyList> selectDailyList(DailyList dailyList);

    int deleteWebDailyListByDailyListIds(Integer[] dailyListIds);




    //(2)周榜


    //查询用户上周的记录
    Integer selectWeeklyList(Integer userId);
    //插入当前数据
    void insertIntoWeeklyListById(WeeklyList weeklyList);
    //更新数据,进行一个累加
    void updateWeeklyList(Integer weeklyListId, Time timeDiff);

    List<WeeklyList> selectWeeklyListList(WeeklyList weeklyList);



















    List<GeneralList> selectGeneralListList(GeneralList generalList);


    int insertWebDailyList(DailyList dailyList);

    DailyList selectWebDailyListByDailyListId(Integer dailyListId);

    GeneralList selectWebGeneralListByGeneralListId(Integer generalListId);

    int insertWebGeneralList(GeneralList generalList);

    int updateWebGeneralList(GeneralList generalList);

    int deleteWebGeneralListByGeneralListIds(Integer[] generalListIds);
}
